<div id="content">
	<div class="row s_page_title">
		<sa-big-breadcrumbs [items]="['供应链管理','生产采购管理','采购申请']" icon="fa fa-cogs" class="col-xs-12 col-sm-7 col-md-7 col-lg-4"></sa-big-breadcrumbs>
	</div>

	<sa-widgets-grid>
		<div class="s_table">
			<div sa-widget [editbutton]="false" color="darken" class="clearfix">
				<header><span class="widget-icon"> <i class="fa fa-table"></i> </span>
					<h2>采购申请</h2>
				</header>
				<div>
					<div class="widget-body no-padding">
						<div class="page-header clearfix s_table_opreation">
							<div class="left page-header-btn" style="width: calc(100% - 220px);">
								<div class="selectDate top_module modify_border">
									<span class="module_text">申请日期</span>
									<table-select-date [notInit]='true' [minDay]='true' [specifyId]='specifyId' (outerTime)="getSelectTableTime($event)" [specifyTime]='specifyTime'></table-select-date>
								</div>
								<div class="top_module top_module_box" style="min-width: auto;">
									<span class="top_module_label module_text">申请类型</span>
									<select name="" class="top_module_select" [(ngModel)]="buyApplyType" style="min-width: 110px;">
										<option value="">全部</option>
										<option value="1">例行采购(授权数额内)</option>
										<option value="2">例行采购(授权数额外)</option>
										<option value="3">例外采购</option>
										<option value="4">损伤增补</option>
										<option value="5">遗失增补</option>
										<option value="6">紧急采购</option>
									</select>
								</div>
								<div class="top_module cancle">
									<span class="module_text">申请部门</span>
									<input type="text" class="module_inp top_module_select ng-pristine ng-valid ng-touched" placeholder="申请部门" [(ngModel)]='applyDepartmet '>
									<div class="s_del_icon" (click)='delKey("applyDepartmet")'>x</div>
								</div>
								<div class="top_module cancle">
									<span class="module_text">申请人</span>
									<input type="text" class="module_inp top_module_select ng-pristine ng-valid ng-touched" placeholder="申请人" [(ngModel)]='applicant'>
									<div class="s_del_icon" (click)='delKey("applicant")'>x</div>
								</div>
								
								<button class="btn btn-primary" (click)="table_search()">查询</button>
								<button  type="button"  class="btn btn-primary" (click)="new_purchase()" *ngIf="addPermission">添加</button>
							</div>
							<!-- <div class="right top-search">
								<input type="text" [(ngModel)]="searchKey" (change)="table_search()" class="search-input" placeholder="车牌号码,公司名称,维修细分...">
								<span class="top-search-box">
									<button class="top-search-btn" type="button" (click)="table_search()"> <i class="fa fa-search"></i></button>
								</span>
							</div> -->
						</div>
						<div class="table_scroll">
							<table class="display dataTables responsive table table-striped table-bordered table-hover dataTable s_h5_table">
								<thead>
									<tr>
										<th>采购申请编号</th>
										<th>申请日期</th>
										<th>申请类型</th>
										<th>申请部门</th>
										<th>申请人</th>
										<th>创建时间</th>
										<th>创建人</th>
										<th>更新时间</th>
										<th>更新人</th>
										<th>操作</th>
									</tr>
								</thead>
								<tbody>
									<tr *ngFor="let row of tableData; let i = index" [attr.data-index]="i">
										<td>{{row.buyApplyNumber}}</td>
										<td>{{row.applyDate}}</td>
										<td>
											<span *ngIf="row.buyApplyType == 1">例行采购(授权数额内)</span>
											<span *ngIf="row.buyApplyType == 2">例行采购(授权数额外)</span>
											<span *ngIf="row.buyApplyType == 3">例外采购</span>
											<span *ngIf="row.buyApplyType == 4">损伤增补</span>
											<span *ngIf="row.buyApplyType == 5">遗失增补</span>
											<span *ngIf="row.buyApplyType == 6">紧急采购</span>
										</td>
										<td>{{row.applyDepartmet}}</td>
										<td>{{row.applicant}}</td>
										<td>{{row.createTime}}</td>
										<td>{{row.createName}}</td>
										<td>{{row.updateTime}}</td>
										<td>{{row.updateName}}</td>
										<td>
											<button type="button" (click)="goPurchaseDetail(row)">查看</button>
											<button type="button" (click)="updata_purchase(row)" *ngIf="editPermission">编辑</button>
											<button type="button" (click)="deleteRow(row)" *ngIf="delPermission">删除</button>
										</td>
									</tr>
								</tbody>
							</table>
						</div>
						<div class="table-fix clearfix">
							<paginator [totalRecords]="totalCount" [rows]="pageSize" [currentPage]="curPage - 1" (onPageChange)="paginate($event)">
							</paginator>
							<button type="button" class="btn default refresh_btn" (click)="refresh()"><i class="fa fa-refresh"></i></button>
						</div>
					</div>
				</div>
			</div>
		</div>
	</sa-widgets-grid>
</div>
<style>
.cancle{
    position: relative;
}
.cancle:hover>.s_del_icon{
    display: inline-block;
}
</style>